package com.edu.neusoft.elec_shop.service;

import com.edu.neusoft.elec_shop.domain.Goods;
import com.edu.neusoft.elec_shop.mapper.GoodsMapper;
import org.springframework.stereotype.Service;
import javax.annotation.Resource;
import java.util.List;

@Service
public class GoodsService {

    @Resource
    private GoodsMapper goodsMapper;

    //添加商品信息
    public int insert(Goods goods) {return goodsMapper.insert(goods);}

    // 获取所有商品信息
    public List<Goods> getAllGoods() {return goodsMapper.getAllGoods();}

    //根据商品id删除商品
    public void deleteGoodsById(Long goodsId) {goodsMapper.deleteGoodsById(goodsId);}
}